<?php
/**
 * @version      BOSSCMS-Free
 * @trademark    BOSSCMS
 * @copyright    Copyright © by BOSSCMS-Free (https://www.bosscms.net/) 保留所有权利
 * @license      https://gitee.com/Greenpeas/BOSSCMS/license/ 和 https://www.bosscms.net/freelicense/
 * @link         https://www.bosscms.net/
 * @author       温州软界网络技术有限公司
**/
defined('IS_OK') or exit('Access Forbidden');
?>
<?php load::into('head'); ?>
<form action="<?php echo url::mpf('items','items','modify'); ?>" method="post" enctype="multipart/form-data">
<section class="main table tree" tree="itemstable" cookie="itemsTableTr">
  <aside>
    <div>
      <div class="head">
        <a class="button green" easy url="<?php echo url::mpf('items','items','edit'); ?>">
          <em class="fa fa-plus"></em>
          <font>添加栏目</font>
        </a>
        <a class="button black treecheck right" tree="itemstable">
          <em class="fa fa-expand"></em>
          <font>收缩栏目</font>
          <em class="fa fa-compress"></em>
          <font>展开栏目</font>
        </a>
      </div>
      <table>
        <tbody>
          <tr>
            <th>选择</th>
            <th>排序</th>
            <th>栏目名称</th>
            <th>栏目模型</th>
            <th>操作</th>
          </tr>
          <?php
          foreach($data['list'] as $v){
          ?>
          <tr level="<?php echo $v['level']; ?>" it="<?php echo $v['id']; ?>">
            <td width="48"><?php echo form::checkbox('id',null,null,array($v['id']=>null)); ?></td>
            <td width="58"><?php echo form::input("sort{$v['id']}",$v['sort'],null,'text',null); ?></td>
            <td lv><?php echo $v['name']; ?> <small>[id: <?php echo $v['id']; ?>]</small></td>
            <td width="138" grey><?php echo $G['option']['type'][$v['type']]; ?></td>
            <td width="248">
              <a class="btnfa black" href="<?php echo url::items($v); ?>" target="_blank">
                <em class="fa fa-eye" title="浏览"></em>
              </a>
              <a class="btnfa black" easy name="修改栏目" url="<?php echo url::mpf('items','items','edit',array('id'=>$v['id'])); ?>">
                <em class="fa fa-pencil" title="修改"></em>
              </a>
              <?php if($v['type']!=0 && $v['level']<$data['max']){?>
              <a class="btnfa green black" easy name="添加子栏目" url="<?php echo url::mpf('items','items','edit',array('parent'=>$v['id'])); ?>">
                <em class="fa fa-plus" title="添加"></em>
              </a>
              <?php } ?>
              <a class="btnfa red delete" url="<?php echo url::mpf('items','items','delete',array('id'=>$v['id'])); ?>">
                <em class="fa fa-trash-o" title="删除"></em>
              </a>
            </td>
          </tr>
          <?php
          }
          ?> 
        </tbody>
      </table>
    </div>
  </aside>
</section>
<section class="refer">
  <a class="button green  checkall">
    <em class="fa fa-square"></em>
    <font>全选</font>
  </a>
  <a class="button green tfa nocheckall">
    <em class="fa fa-square-o"></em>
    <font>取消</font>
  </a>
  <button class="button green ">
    <em class="fa fa-sort"></em>
    <font>排序</font>
  </button>
  <a class="button red tfa delcheck" url="<?php echo url::mpf('items','items','delete'); ?>">
    <em class="fa fa-trash-o"></em>
    <font>删除</font>
  </a>
</section> 
</form>
<?php load::into('foot'); ?>